package d0325;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

public class TestMessageFormat {
    public static void main(String[] args) throws Exception {



            FileReader fr = new FileReader(new File("src/d0325/message.properties"));
            Properties properties=new Properties();
            properties.load(fr);
            String pattern=properties.getProperty("pattern");

            //String pattern="{0}您好，应付金额是{1}";
            System.out.println(MessageFormat.format(pattern,new Object[]{"ALICE",123}));
            System.out.println(MessageFormat.format(pattern,new Object[]{"TOM",250}));






    }
}
